﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'branchGetByCompany')
	BEGIN
		DROP  Procedure  branchGetByCompany
	END
GO

CREATE PROCEDURE [dbo].[branchGetByCompany]
	-- Add the parameters for the stored procedure here
	@company_id INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT convert(int,suc_Id) AS lit_sucursal_id, suc_nombre AS lit_sucursal_nombre, convert(int,emp_id) AS lit_empresa_id 
	FROM sucursal
	WHERE emp_id = @company_id;
END
GO